/**
 * Created by Jay on 2016/6/15.
 */
function report_user_stick(){
    /*search*/
    $("body").off();//解绑
    $("body").on("click",".rep_search",function(){
        sessionStorage.setItem("this_page_click_num",1);//初始值为1
        page_i=0;//add值
        var this_search=$(".rep_search_real").val();
        if(this_search==" "){
            return;
        }
        $.ajax({
                url:"memberController/searchInformQA",
                method:"POST",
                data:{pageSize:10,pageNo:1,informReason:$("#select_s").val(),status:$("#select_d").val(),informType:2}
         })
        .done(function(data){
                //console.log(data.result);
                if(data.pageNo==undefined){
                    console.log("empty");
                    $("#layPage").css({
                        display:"none"
                    })
                }else{
                    $("#layPage").css({
                        display:"block"
                    })
                    create_page({
                        url:"memberController/searchInformQA",
                        method:"POST",
                        data:data,
                        temp:"getColumnTableData_report_detail",
                        contain:"#ColumnTableData_report_detail",
                        prePageSize:data.result.pageSize,
                        prepageNo:data.result.pageNo
                    })//生成分页
                }
                //console.log("aa");
                //console.log(data);
                //data.result.resultList=data.result;
                set_seqsum(
                    {
                        pageNo:data.result.pageNo,
                        pageSize:data.result.pageSize
                    }
                );
                var return_data=1*data.result.pageNo;//返回的首位数
                sessionStorage.setItem("pageNo",data.result.pageNo);
                sessionStorage.setItem("pageSize",data.result.pageSize);
                sessionStorage.setItem("return_data",return_data);
                var page=get_page_size();
                mccmsa.getHtmlFromLocalTemplate({   //将数据打包到模版丢进容器
                    templateId:"getColumnTableData_report_detail",
                    container:$("#ColumnTableData_report_detail"),
                    data:data,
                    callback:function(){
                    }
                })
            })
            .fail(function(){
                console.log("fail");
            })
    })
    /*search end*/
    mccmsa.ajax({
        url:"memberController/showInformQuestionAnswer",
        method: "get",
        data: {pageSize: 10, pageNo: 1,informType:2},
        success: function (data) {
            var prepageSize=data.result.pageSize;
            //console.log(data);
            var obj={informType:2};
            set_seqsum(
                {
                    pageNo:data.result.pageNo,
                    pageSize:data.result.pageSize
                }
            );
            create_page({
                url:"memberController/showInformQuestionAnswer",
                temp:"getColumnTableData_report_detail",
                contain:"#ColumnTableData_report_detail",
                method:"get",
                data:data,
                add_data:obj,
                prePageSize:data.result.pageSize,
                prepageNo:data.result.pageNo
            })
            mccmsa.getHtmlFromLocalTemplate({   //将数据打包到模版丢进容器
                templateId: "getColumnTableData_report_detail",
                container: $("#ColumnTableData_report_detail"),
                data: data,
                callback:function(){

                }
            })
        }
    })
    $("body").on("click",".success_s",function(){
         var info_id=$(this).attr("info-id");
        delete_tips({
            url:"memberController/auditInformInfo",
            data:{informId:info_id,status:1},
            method:"get",
            content:"通过审核？",
            alert:"成功通过审核",
            alert_error:"出错了"
        })
    })//通过的。。。。
    $("body").on("click",".fail_s",function(){
        var info_id=$(this).attr("info-id");
        delete_tips({
            url:"memberController/auditInformInfo",
            data:{informId:info_id,status:2},
            method:"get",
            content:"不通过审核？",
            alert:"成功不通过审核",
           alert_error:"出错了"
        })
    })
    //memberController/delInformRecord
    $("body").on("click",".delete_s",function(){
        var info_id=$(this).attr("info-id");
        delete_tips({
            url:"memberController/delInformRecord",
            data:{informId:info_id,status:1},
            method:"get",
            content:"删除？",
            alert:"成功删除",
            alert_error:"出错了"
        })
    })
}